home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Deutsche Edition 1
/
Deutsche Edition 1.iso
/
amok
/
amok_lha
/
amok15.lha
/
Seafarers_Manual
/
Source
/
C2P4.mod
< prev
next >
Wrap
Text File
|
1993-08-15
|
617b
|
25 lines
MODULE C2P4; (* Chapter 2 Problem 4 *)
(* Real Calculation Sample *)
(* From the book "Modula-2 A Seafarer's Manual and Shipyard Guide" *)
(* Page 40 adapted "M2Amiga Modula-2" 26 Feb 1988 *)
FROM InOut IMPORT WriteLn,
WriteString;
FROM RealInOut IMPORT WriteReal;
VAR
Result : REAL;
BEGIN
WriteString ("Real Calculation Sample: ");
WriteLn; WriteLn; WriteLn;
WriteString ("The result of the calculation (((1.0/3.0)*3.0)-1.0) = ");
Result := 1.0 / 3.0;
Result := Result * 3.0;
Result := Result - 1.0;
WriteReal (Result,20,15);
WriteLn;
END C2P4.